package Aleehot100;

/**
 * ClassName: c083
 * Package: Aleehot100
 * Description:198. 打家劫舍
 *
 * @Author BCXJ
 * @Create 2025/9/7 08:16
 * @Version 1.0
 * @Since 1.0
 */
public class c083 {
    public static void main(String[] args) {
        System.out.println(-10 % 3);
    }

    public static int rob(int[] nums) {
        int pre1 = 0;
        int pre2 = 0;
        int cur = 0; // 当前最大的金额
        for (int i = 0; i < nums.length; i++) {
            cur = Math.max(pre2 + nums[i], pre1);
            pre2 = pre1;
            pre1 = cur;
        }
        return pre1;
    }
}
